package com.czk.practice.server.handler;

import com.czk.practice.codec.Decoder;
import com.czk.practice.codec.Encoder;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/8/19 15:20
 */
public class MyChannelInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel channel) throws Exception {
        ChannelPipeline pipeline = channel.pipeline();
        pipeline.addLast(new Decoder());
        pipeline.addLast(new Encoder());
        pipeline.addLast(new MsgHandler1());
        pipeline.addLast(new MyHandler2());
    }
}
